package com.mk.admin.controller;

import com.mk.admin.model.ResultDto;
import com.mk.admin.model.query.*;
import com.mk.admin.model.vo.InHospitalAddBeInProofVo;
import com.mk.admin.model.vo.InHospitalAddBeInRegisterVo;
import com.mk.admin.model.vo.InHospitalProjectCancelVo;
import com.mk.admin.model.vo.InHospitalProjectConfirmVo;
import com.mk.admin.service.InHospitalService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/a/adm/inHospital")
@Api(tags = "住院服务")
public class InHospitalController {
    @Autowired
    private InHospitalService inHospitalService;

    @PostMapping("/byCardType")
    @ApiOperation(value = "ipt_0001住院患者信息查询", notes = "通过证件/卡号和类型获得病人基本信息，平台通过本接口匹配患者信息，通过对比返回的患者信息与患者输入的身份证号、姓名等关键信息是否一致，如果一致则可进行患者信息绑定（日期降序排序）")
    public ResultDto byCardType(@RequestBody InHospitalByCardTypeQuery query) {
        return inHospitalService.byCardType(query);
    }

    @PostMapping("/beInlist")
    @ApiOperation(value = "ipt_0002住院清单查询", notes = "住院清单查询（日期降序排序）")
    public ResultDto beInlist(@RequestBody InHospitalBeInlistQuery query) {
        return inHospitalService.beInlist(query);
    }

    @PostMapping("/projectConfirm")
    @ApiOperation(value = "ipt_0003住院项目确认", notes = "住院项目确认")
    public ResultDto projectConfirm(@RequestBody InHospitalProjectConfirmVo vo) {
        return inHospitalService.projectConfirm(vo);
    }

    @PostMapping("/projectCancel")
    @ApiOperation(value = "ipt_0004住院项目取消", notes = "住院项目取消")
    public ResultDto projectCancel(@RequestBody InHospitalProjectCancelVo vo) {
        return inHospitalService.projectCancel(vo);
    }


    @PostMapping("/preparePayBalance")
    @ApiOperation(value = "ipt_0005住院预交金余额查询", notes = "住院预交金余额查询")
    public ResultDto preparePayBalance(@RequestBody InHospitalPreparePayBalanceQuery query) {
        return inHospitalService.preparePayBalance(query);
    }

    @PostMapping("/preparePayRecord")
    @ApiOperation(value = "ipt_0006住院预交金缴纳记录查询", notes = "住院预交金缴纳记录查询")
    public ResultDto preparePayRecord(@RequestBody InHospitalPreparePayRecordQuery query) {
        return inHospitalService.preparePayRecord(query);
    }

    @PostMapping("/diagnosis")
    @ApiOperation(value = "ipt_0009住院诊疗信息查询", notes = "住院诊疗信息查询")
    public ResultDto diagnosis(@RequestBody InHospitalDiagnosisQuery query) {
        return inHospitalService.diagnosis(query);
    }

    @PostMapping("/prepareInProof")
    @ApiOperation(value = "ipt_0010入院登记凭证信息查询", notes = "用户进行入院登记操作，只有在住院状态为“未办理住院手续”时才能调用")
    public ResultDto prepareInProof(@RequestBody InHospitalPrepareInProofQuery query) {
        return inHospitalService.prepareInProof(query);
    }

    @PostMapping("/advice")
    @ApiOperation(value = "ipt_0011查询医嘱", notes = "查询患者的医嘱信息")
    public ResultDto advice(@RequestBody InHospitalAdviceQuery query) {
        return inHospitalService.advice(query);
    }

    @PostMapping("/addBeInProof")
    @ApiOperation(value = "ipt_0012开具入院证", notes = "用户进行入院登记操作")
    public ResultDto addBeInProof(@RequestBody InHospitalAddBeInProofVo vo) {
        return inHospitalService.addBeInProof(vo);
    }

    @PostMapping("/addBeInRegister")
    @ApiOperation(value = "ipt_0013入院登记", notes = "用户进行入院登记操作")
    public ResultDto addBeInRegister(@RequestBody InHospitalAddBeInRegisterVo vo) {
        return inHospitalService.addBeInRegister(vo);
    }

    @PostMapping("/diagnosisFeeDetail")
    @ApiOperation(value = "ipt_0014查询住院诊疗费用清单明细", notes = "查询住院诊疗费用清单明细")
    public ResultDto diagnosisFeeDetail(@RequestBody InHospitalDiagnosisFeeDetailQuery query) {
        return inHospitalService.diagnosisFeeDetail(query);
    }

    @PostMapping("/outInDepartmentRecord")
    @ApiOperation(value = "ipt_0015查询入科出科记录", notes = "查询入科出科记录")
    public ResultDto outInDepartmentRecord(@RequestBody InHospitalOutInDepartmentRecordQuery query) {
        return inHospitalService.outInDepartmentRecord(query);
    }

    @PostMapping("/operate")
    @ApiOperation(value = "ipt_1011手术信息查询")
    public ResultDto operate(@RequestBody InHospitalOperateQuery query) {
        return inHospitalService.operate(query);
    }
    @PostMapping("/outHospitalMedical")
    @ApiOperation(value = "ipt_0031出院带药信息")
    public ResultDto outHospitalMedical(@RequestBody InHospitalOutHospitalMedicalQuery query) {
        return inHospitalService.outHospitalMedical(query);
    }
}
